package org.jeecg.modules.demo.yhs.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.yhs.POJO.History;
import org.jeecg.modules.demo.yhs.POJO.Shistory;

import java.util.List;

@Mapper
public interface HistoryMapper {

    @Select("SELECT id,vip.`name`,v_type.`typeway`,shop.`shopname`,money,DATETIME AS DATETIME FROM shop,vip,v_type,history WHERE shop.`shopid`=history.`shopid` AND history.`typeid`=v_type.`typeid` AND vip.`vipid`=history.vipid ORDER BY DATETIME DESC LIMIT 6")
    List<History> findAll();

    @Insert("insert into history values(null,#{vipid},#{typeid},#{shopid},#{money},#{datetime})")
    int insert(Shistory history);
}
